﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using KeMei.BLL;
using System.Data;
using KeMei.Common;

public partial class Controls_Left : System.Web.UI.UserControl
{
    public string url = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        Syslm bll = new Syslm();

        if (Request["type"] == "1" || Request["type"] == "3" || Request["type"] == "5")
        {
            url = ConfigHelper.SystemUrl + "ProductCenter/ProductCenterList.aspx?type=" + Request["type"] + "&Id=";
            lbTitle.Text = "产品中心";
            DataSet ds = bll.GetList("(ParentID = 1 ) order by id asc");
            DataTable dt = ds.Tables[0];
            if (dt.Rows.Count > 0)
            {
                repLeftMenu.DataSource = dt;
                repLeftMenu.DataBind();
            }
        }
        else if (Request["type"] == "2")
        {
            url = ConfigHelper.SystemUrl + "ApplicationCase/ApplicationCaseList.aspx?type=2&Id=";
            lbTitle.Text = "应用案例";
            DataSet ds = bll.GetList("(ParentID = 2) order by id asc");
            DataTable dt = ds.Tables[0];
            if (dt.Rows.Count > 0)
            {
                repLeftMenu.DataSource = dt;
                repLeftMenu.DataBind();
            }
        }
        else if (Request["type"] == "4")
        {
            url = ConfigHelper.SystemUrl + "AboutUs/AboutUs.aspx?type=4&Id=";
            lbTitle.Text = "大晟抛光材料";
            DataSet ds = bll.GetList("(ParentID = 4) order by id asc");
            DataTable dt = ds.Tables[0];
            if (dt.Rows.Count > 0)
            {
                repLeftMenu.DataSource = dt;
                repLeftMenu.DataBind();
            }
        }
        else
        {
            url = ConfigHelper.SystemUrl + "ProductCenter/ProductCenterList.aspx?type=1&Id=";
            lbTitle.Text = "产品中心";
            DataSet ds = bll.GetList("(ParentID = 1) order by id asc");
            DataTable dt = ds.Tables[0];
            if (dt.Rows.Count > 0)
            {
                repLeftMenu.DataSource = dt;
                repLeftMenu.DataBind();
            }
        }
    }
}